﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Controls;

namespace WasaWasa.Converters
{
    public class DecimalInInt32ValidationRule : ValidationRule
    {
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            decimal d;
            bool b = decimal.TryParse(value as string, out d);
            b &= (d == decimal.ToUInt32(d));
            return new ValidationResult(b, null);
        }
    }
}
